.organization-tree-select-wrapper {
  .check-all-row {
    margin-bottom: 8px;

    .check-all-label {
      display: flex;
      align-items: center;
      cursor: pointer;
      font-size: 14px;
      color: rgba(0, 0, 0, 0.85);

      input[type="checkbox"] {
        margin-right: 8px;
      }
    }
  }
}

.organization-tree-select {
  min-width: 250px;

  .org-tree-user-node {
    display: flex;
    align-items: center;
    padding: 4px 0;

    .org-tree-user-avatar {
      width: 24px;
      height: 24px;
      border-radius: 50%;
      margin-right: 8px;
    }

    .org-tree-user-info {
      display: flex;
      flex-direction: column;

      .org-tree-user-name {
        font-weight: 500;
        line-height: 1.2;
      }

      .org-tree-user-position {
        font-size: 12px;
        color: rgba(0, 0, 0, 0.45);
      }
    }
  }

  .org-tree-org-node {
    font-weight: bold;
    color: #1677ff;
  }

  .org-tree-department-node {
    font-weight: 500;
    color: #52c41a;
  }

  // 勾选框模式下的样式
  &.ant-select-tree-checkbox {
    .ant-select-selection-item {
      display: inline-flex;
      align-items: center;
    }
  }

  // 自定义复选框样式
  .ant-tree-checkbox {
    .ant-tree-checkbox-inner {
      border-radius: 2px;
      border-color: #d9d9d9;
      background-color: #fff;

      // 复选框大小调整
      width: 16px;
      height: 16px;

      // 选中状态的背景色
      &::after {
        // 修改对勾样式
        border-color: #fff;
        transition: all 0.2s;
      }
    }

    // 选中状态
    &.ant-tree-checkbox-checked {
      .ant-tree-checkbox-inner {
        background-color: #1677ff;
        border-color: #1677ff;
      }
    }

    // 半选中状态
    &.ant-tree-checkbox-indeterminate {
      .ant-tree-checkbox-inner {
        background-color: #fff;
        border-color: #d9d9d9;

        // 半选中状态的方块样式
        &::after {
          top: 50%;
          left: 50%;
          width: 8px;
          height: 8px;
          background-color: #1677ff;
          border: 0;
          transform: translate(-50%, -50%);
          opacity: 1;
          content: " ";
        }
      }
    }

    // 鼠标悬停状态
    &:hover {
      .ant-tree-checkbox-inner {
        border-color: #1677ff;
      }
    }

    // 禁用状态
    &.ant-tree-checkbox-disabled {
      .ant-tree-checkbox-inner {
        background-color: #f5f5f5;
        border-color: #d9d9d9 !important;

        &::after {
          border-color: rgba(0, 0, 0, 0.25);
        }
      }
    }
  }
}

// 自定义下拉菜单样式
.organization-tree-dropdown {
  max-height: 400px;
  overflow-y: auto;

  .ant-tree-node-content-wrapper {
    display: flex;
    align-items: center;
  }
}

// 多选标签样式
.ant-select-selection-item {
  display: flex;
  align-items: center;
  padding: 2px 8px !important;
  margin: 2px !important;

  .org-tree-user-avatar {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    margin-right: 4px;
  }
}

// 自定义标签样式
.org-tree-tag {
  margin-right: 4px;
  vertical-align: middle;

  &.user-tag {
    background-color: #e6f7ff;
    border-color: #91d5ff;
    color: #1890ff;
    padding: 0 4px 0 0;
    display: flex;

    .user-tag-content {
      display: flex;
      align-items: center;

      .tag-user-avatar {
        width: 18px;
        height: 18px;
        border-radius: 50%;
        margin-right: 6px;
      }

      .tag-user-position {
        font-size: 12px;
        color: rgba(0, 0, 0, 0.45);
        margin-left: 4px;
        max-width: 60px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
    }
  }

  &.department-tag {
    background-color: #f6ffed;
    border-color: #b7eb8f;
    color: #52c41a;
  }

  &.org-tag {
    background-color: #fff7e6;
    border-color: #ffd591;
    color: #fa8c16;
  }
}

// 调整删除按钮的位置
.ant-tag-close-icon {
  margin-left: 4px;
  vertical-align: middle;
}

// 多选标签样式需要调整
.organization-tree-select.ant-select-multiple {
  .ant-select-selection-overflow-item {
    margin: 1px !important;

    .ant-select-selection-item {
      padding: 0 4px 0 8px !important;
    }
  }
}
